
<!DOCTYPE html>
<html class="no-js">

<head>
<meta charset="utf-8">
<title>登录</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<link rel="stylesheet" href="__PUBLIC__/css/loginStyle.css">
<link rel="icon" href="__PUBLIC__/images/cropped-LOGO-32x32.png" sizes="32x32">
<link rel="icon" href="__PUBLIC__/images/cropped-LOGO-180x180.png" sizes="180x180">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
	<script src="__PUBLIC__/js/html5.js"></script>
<![endif]-->
<script src="__PUBLIC__/js/jquery.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/layer/layer.js"></script> 
</head>

<body>
<div class="wrapper">
	<div class="container">
		<img class="loginLogo" src="__PUBLIC__/images/logo.png" >
		<h1>BIM项目管理平台</h1>
		<form class="form" action="index.html" id="login_form" method="post">
			<input type="text" id="email" name="username" placeholder="账号">
			<input type="password" id="password" name="password" placeholder="密码">
			<div class="verifyBox">
				<input id="j_captcha" name="j_captcha" type="text" placeholder="验证码" class="form-control x164 in">
				<img class="captchaImg" alt="点击更换" title="点击更换" src="{:U('Admin/verify')}" id="verify_code_img" onclick="verify(this)" />
			</div>
			<button type="submit" onclick="login();return false;">登录</button>
			<button type="reset">重置</button>
		</form>
	</div>
	<ul class="bg-bubbles"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul>
</div>
<div class="copyrightBottom">
	<p>				
		<span>Copyright © 2016-2017 BuildingCredit</span>
		<span>
			<a href="http://www.miitbeian.gov.cn/" target="_blank">浙ICP备16039964号-1</a>
			<i class="b-icon b-icon-icp"></i>
		</span>			
		<span>
			<i class="b-icon b-icon-zgwablogo"></i>
			<a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=33010402002789" target="_blank">浙公网安备 33010402002789号</a>
		</span>
	</p>					
</div>
<script type="text/javascript">
	$('#login-button').click(function(event){
		event.preventDefault();
		$('form').fadeOut(400);
		$('.wrapper').addClass('form-success');
	});
</script>
</body>

</html>
<script>
	//登录页判断
	function login(){
		var username = $("input[name='username']").val();
		var password = $("input[name='password']").val();
		var j_captcha = $("input[name='j_captcha']").val();
		if(username == ''){
	 		 layer.msg('账号不能为空',{time:2000});
	 		 return;
	 		} 
		if(password == ''){
			 layer.msg('密码不能为空',{time:2000});
			 return;
			} 
		if(j_captcha == ''){
			 layer.msg('验证码不能为空',{time:2000});
			 return;
			} 
		$.ajax({
	          type: "POST",
	          url: "/home/Admin/login",
	          data: {username:username,password:password,verify:j_captcha},
	          dataType: "json",
	          success:function(res){
					if(res.status==1){
				     	top.location.href = res.url;
					}else{
						//layer.msg(res.msg, {icon: 2});
						 layer.msg(res.msg,{time:2000});
					}
				},
				error : function(XMLHttpRequest, textStatus, errorThrown) {
					layer.alert('网络失败，请刷新页面后重试', {icon: 2});
				}
	      }); 
	}

	function verify(){
	    $('#verify_code_img').attr('src','/Admin/verify?r='+Math.random());
	}

</script>